Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: docstrings for List.mapM and friends #3867

Merged
merged 3 commits into from
Apr 13, 2024
Merged

doc: docstrings for List.mapM and friends #3867

merged 3 commits into from
Apr 13, 2024

Conversation

nomeata
Copy link
Collaborator

@nomeata nomeata commented Apr 10, 2024

No description provided.

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc April 10, 2024 12:57 Inactive
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Apr 10, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc April 10, 2024 17:44 Inactive
@@ -71,15 +103,27 @@ def filterAuxM {m : Type → Type v} [Monad m] {α : Type} (f : α → m Bool) :
let b ← f h
filterAuxM f t (cond b (h :: acc) acc)

/--
Applies the monadic predicate `f` on every element in the list, left-to-right, and returns those
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename f to p?

@[inline]
def filterM {m : Type → Type v} [Monad m] {α : Type} (f : α → m Bool) (as : List α) : m (List α) := do
let as ← filterAuxM f as []
pure as.reverse

/--
Applies the monadic predicate `f` on every element in the list, right-to-left, and returns those
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to p?

Co-authored-by: David Thrane Christiansen <[email protected]>
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc April 11, 2024 06:00 Inactive
@nomeata nomeata added this pull request to the merge queue Apr 13, 2024
Merged via the queue into master with commit 9eeecb6 Apr 13, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants